﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScreenTester;
using ScreenTesterDriver.Properties;
using System.IO;

namespace ScreenTesterDriver
{
    class Program
    {
        static void Main(string[] args)
        {
            string testcasesFolder = Settings.Default.ExecuteFolderPath;
            if (!Directory.Exists(testcasesFolder))
            {
                Console.WriteLine("The folder '{0}' does not exist", testcasesFolder);
                return;
            }

            string[] files = Directory.GetFiles(testcasesFolder, "*.scrntst");
            foreach (string filename in files)
            {
                try
                {
                    TestCaseRunner runner = new TestCaseRunner(filename
                        , Settings.Default.ResultFolderPath);
                    runner.Run();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }

            Console.WriteLine("Press any key to quit...");
            Console.Read();
        }
    }
}
